package mobileann.mafamily.utils;

import mobileann.mafamily.act.main.WelcomeActivity;
import android.content.Context;
import android.content.Intent;

public class DataKeepUtil {
	private static final String DataTag = WelcomeActivity.class.getSimpleName();

	private static DataKeepUtil instance;

	public static DataKeepUtil getInstance(){
		if(instance == null){
			instance = new DataKeepUtil();
		}
		return instance;
	}

	public void setDataKeepTag(){
		SPUtils.setDataKeepTag(true);
	}

	public void gotoWelcome(Context act){
		String tag = act.getClass().getSimpleName();
		if(!SPUtils.getDataKeepTag() && !DataTag.equals(tag)){
			act.startActivity(new Intent(act, WelcomeActivity.class));
		}
	}
}
